package com.huixh.train.batch.config;

import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.Environment;

/**
 * @author huixh
 */
@SpringBootApplication
@ComponentScan("com.huixh.train")
@MapperScan("com.huixh.train.*.mapper")
@EnableDiscoveryClient
@EnableFeignClients(basePackages = "com.huixh.train.batch.client")
public class BatchApplication {

    private static final Logger LOG = LoggerFactory.getLogger(BatchApplication.class);
    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(BatchApplication.class,args);
        Environment env = context.getEnvironment();
        LOG.info("启动成功！！");
        LOG.info("项目基础地址: http://127.0.0.1:{}{}",env.getProperty("server.port"),env.getProperty("server.servlet.context-path"));
    }
}
